<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<title>招募城市列表</title>
	</head>
	<body>
		<form action="<c:url value='/skoru/town.do'/>" method="post">
			<dict:dict var="skoruTownTypeList" type="skoruTownType" />
			<table class="table-layout">
				<tr class="tr-odd">
					<td class="td-label">
						省:
					</td>
					<td>
					<div id="dropContainer_0">
						<input type="hidden" name="filter_EQS_provinceId" value="<c:out value="${filters.EQS_provinceId}" />" />
						<select id="drop_0"></select>
					<div>
					</td>
				</tr>
				<tr class="tr-even">
					<td class="td-label">
						市:
					</td>
					<td>
					<div id="dropContainer_1">
						<input type="hidden" name="filter_EQS_cityId" value="<c:out value="${filters.EQS_cityId}" />" />
						<select id="drop_1"></select>
					<div>
					</td>
				</tr>
				<tr class="tr-odd">
					<td class="td-label">
						区:
					</td>
					<td>
					<div id="dropContainer_2">
						<input type="hidden" name="filter_EQS_districtId" value="<c:out value="${filters.EQS_districtId}" />" />
						<select id="drop_2"></select>
					<div>
					</td>
				</tr>
				<tr class="tr-even">
					<td class="td-label">
						年份:
					</td>
					<td>
						<input type="text" name="filter_EQS_planAge" value="<c:out value="${filters.EQS_planAge}" />" />
					</td>
				</tr>
			</table>
			<br />
			<div class="right-opertion">
				<input type="button" value="搜索" onclick="search(this);" class="button" />
			</div>
			<br />
			<table class="table-layout">
				<tr class="tr-thead">
					<th>
						<a href="javascript:void(0);" onclick="javascript:sort('id',this)">ID</a>
					</th>
					<th>
						<a href="javascript:void(0);" onclick="javascript:sort('provinceId',this)">省</a>
					</th>
					<th>
						<a href="javascript:void(0);" onclick="javascript:sort('cityId',this)">市</a>
					</th>
					<th>
						<a href="javascript:void(0);" onclick="javascript:sort('districtId',this)">区</a>
					</th>
					<th>
						<a href="javascript:void(0);" onclick="javascript:sort('typeCode',this)">网络形态</a>
					</th>
					<th>
						<a href="javascript:void(0);" onclick="javascript:sort('planAge',this)">计划年份</a>
					</th>
					<th>
						<a href="javascript:void(0);" onclick="javascript:sort('planedQuantity',this)">计划数量</a>
					</th>
					<th>
						操作
					</th>
				</tr>
				<logic-el:iterate name="page" property="result" id="town" indexId="index">
					<tr class="<c:if test="${index % 2 == 0}">tr-odd</c:if><c:if test="${index % 2 == 1}">tr-even</c:if>">
						<td>
							<c:out value="${town.id}" />
							&nbsp;
						</td>
						<td>
							<logic:iterate id="prov" name="provinces">
								<c:if test="${prov.code == town.provinceId}">
									<c:out value="${prov.name}" />
								</c:if>
							</logic:iterate>
							&nbsp;
						</td>
						<td>
							<logic:iterate id="city" name="cities">
								<c:if test="${city.code == town.cityId}">
									<c:out value="${city.name}" />
								</c:if>
							</logic:iterate>
							&nbsp;
						</td>
						<td>
							<logic:iterate id="dist" name="districts">
								<c:if test="${dist.code == town.districtId}">
									<c:out value="${dist.name}" />
								</c:if>
							</logic:iterate>
							&nbsp;
						</td>
						<td>
							<logic:iterate id="t" name="skoruTownTypeList">
								<c:if test="${t.code == town.typeCode}">
									<c:out value="${t.dictName}" />
								</c:if>
							</logic:iterate>
							&nbsp;
						</td>
						<td>
							<c:out value="${town.planAge}" />
							&nbsp;
						</td>
						<td>
							<c:out value="${town.planedQuantity}" />
							&nbsp;
						</td>
						<td>
							<a href="<c:url value='town.do?method=edit&id=${town.id}'/>">修改</a>&nbsp; <a href="javascript:void(0)" onclick="if(confirm('确定要删除该记录吗？')) location.href='<c:url value='town.do?method=erase&id=${town.id}'/>'">删除</a>&nbsp;
						</td>
					</tr>
				</logic-el:iterate>
			</table>
			<page:page name="page" />
		</form>
		<br />
		<div class="center-opertion">
			<button onclick="location.href='town.do?method=edit'" class="button">
				添加
			</button>
		</div>
	<script type="text/javascript">
 		var codeElementName = ["filter_EQS_provinceId","filter_EQS_cityId","filter_EQS_districtId"];
		var dropDownData = eval('('+'<%=pageContext.getServletContext().getAttribute("pcdJson")%>'+')');
		showDropDown(dropDownData,codeElementName);
	</script>
	</body>
</html>
